Skip to content

[ENG-11229][fix] osfmetrics preprint count migration#11741

Merged
aaxelb merged 2 commits into
CenterForOpenScience:developfrom
aaxelb:fix/osfmetrics-preprint-count-migration
May 18, 2026
Merged

[ENG-11229][fix] osfmetrics preprint count migration#11741
aaxelb merged 2 commits into
CenterForOpenScience:developfrom
aaxelb:fix/osfmetrics-preprint-count-migration

Conversation

@aaxelb
Copy link
Copy Markdown
Collaborator

@aaxelb aaxelb commented May 15, 2026

Ticket

Purpose

osfmetrics 6to8 data migration is missing some view/download counts

Changes

in migrate_osfmetrics_6to8:

  • when getting cumulative counts for a preprint osfid_v1, search for preprint_id: [“osfid_v1”, “osfid”]
  • when scheduling tasks to migrate public usage reports, aggregate osfids from usage reports, usage events, preprint views, and preprint downloads (instead of just usage reports)
  • when there are no monthly usage reports for an item (but there are older views/downloads), create a “last month” usage report with cumulative counts up to that point

Side Effects

while touching this again, also...

  • change item_type in es8 OsfCountedUsageEvent and MonthlyPublicItemUsageReport to use the short name of the osfmap type, rather than full iri
  • stop calling setup at start of migrate_osfmetrics_6to8 (and remove --no-setup arg)
  • ensure consistent database_iri (a COUNTER field that's kinda mapped from osf "provider")

QE Notes

CE Notes

Documentation

aaxelb added 2 commits May 15, 2026 12:13
in osfmetrics 6to8 migration, when building cumulative view/download
counts for preprints, make sure to include usage stored under the
preprint's unversioned osfid with the osfid_v1 usage reports (since
PreprintView/PreprintDownload started saving under versioned osfid)
so those older views don't get lost in migration
@aaxelb aaxelb marked this pull request as ready for review May 15, 2026 17:59
@aaxelb aaxelb requested a review from felliott May 15, 2026 18:00
Copy link
Copy Markdown
Member

@felliott felliott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aaxelb aaxelb merged commit 5cb7824 into CenterForOpenScience:develop May 18, 2026
8 checks passed
@aaxelb aaxelb deleted the fix/osfmetrics-preprint-count-migration branch May 18, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants